<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/6/006
 * Time: 11:25
 */

namespace app\admin\validate;


use think\Validate;

class Role extends Validate
{
    protected $rule = [
        'role_name'  =>  'require|max:20',
        'describe' =>  'require|max:50',
        'id' =>  'require',
    ];

    protected $message = [
        'role_name.require'  =>  '请填写角色名称',
        'role_name.max'  =>  '角色名称最长不能超过20个字符',
        'describe.require' =>  '请填写角色描述',
        'describe.max' =>  '角色描述最多不能超过50个字符',
        'id.require' =>  '缺少参数',
    ];

    protected $scene = [
        'add'   =>  ['role_name','describe'],
        'edit'  =>  ['role_name','describe','id'],
    ];
}